package org.lalib.controller.form;

import java.util.ArrayList;
import java.util.List;

import javax.faces.bean.SessionScoped;

import org.lalib.acquire.IControllerForm;
import org.lalib.entity.object.ETable;
import org.lalib.entity.object.EUser;
import org.springframework.stereotype.Controller;

@SessionScoped
@Controller("cUserTableMatchForm")
public class CUserTableMatchForm implements IControllerForm {

	private static final long serialVersionUID = 1L;

	private EUser user;
	private List<ETable> tables = new ArrayList<>();
	private List<TableMatchBean> includedTableBeans = new ArrayList<>();
	private List<TableMatchBean> excludedTableBeans = new ArrayList<>();

	public class TableMatchBean {

		private ETable table;
		private boolean selected;

		public TableMatchBean() {
		}

		public TableMatchBean(ETable eTable) {
			setTable(eTable);
		}

		public ETable getTable() {
			return table;
		}

		public void setTable(ETable table) {
			this.table = table;
		}

		public boolean isSelected() {
			return selected;
		}

		public void setSelected(boolean selected) {
			this.selected = selected;
		}
	}

	public EUser getUser() {
		return user;
	}

	public void setUser(EUser user) {
		this.user = user;
	}

	public List<ETable> getTables() {
		return tables;
	}

	public void setTables(List<ETable> tables) {
		this.tables = tables;
	}

	public List<TableMatchBean> getIncludedTableBeans() {
		return includedTableBeans;
	}

	public void setIncludedTableBeans(List<TableMatchBean> includedTableBeans) {
		this.includedTableBeans = includedTableBeans;
	}

	public List<TableMatchBean> getExcludedTableBeans() {
		return excludedTableBeans;
	}

	public void setExcludedTableBeans(List<TableMatchBean> excludedTableBeans) {
		this.excludedTableBeans = excludedTableBeans;
	}
}